package com.lizhen.core.datastructure;

import java.util.Vector;

public class VectorDataStructure {
    public static void main(String[] args) {
        Vector<Object> vector = new Vector<>(3, 2);

        System.out.println("Initial vector size: " + vector.size());
        System.out.println("Initial vector capacity: " + vector.capacity());

        vector.addElement(new Integer(1));
        vector.addElement(new Integer(2));
        vector.addElement(new Integer(3));
        vector.addElement(new Integer(4));
        vector.addElement(new Double(5.45));
        vector.addElement(new Double(2.12));

        System.out.println("Current vector size: " + vector.size());
        System.out.println("Current vector capacity: " + vector.capacity());
    }
}